var events = require('events');
var Emitter = events.EventEmitter;
function Dog(dogName){
    Emitter.call(this);//实现对EventEmitter继承的过程
    this.dogName = dogName;
}
Dog.prototype = Emitter.prototype;//实现对EventEmitter继承的过程
Dog.prototype.bark = function(){
    console.log(this.dogName+'barked');
}
module.exports = Dog;//对外公布Dog构造函数